home *** CD-ROM | disk | FTP | other *** search
Verilog source code | 1992-06-18 | 1.2 KB | 79 lines | [TEXT/MPS ] |
- module cntrl(reset,clock,a,start,rw,ack,near,vras,mras,cas,ma,w);
-
- input [31: 0]a;
- input reset, clock;
- input start, near, rw;
-
- output ack;
- reg ack;
-
- output cas;
- reg cas;
-
- output mras;
- reg mras;
-
- output vras;
- reg vras;
-
- output [ 9: 0]ma;
- reg [ 9: 0]ma;
-
- output w;
- reg w;
-
- always @(negedge reset) begin
- mras = 1;
- vras = 1;
- cas = 1;
- w = 0;
- ack = 1;
- end
-
- always @(posedge clock)
- if (reset && ~start) begin
- if (mras & vras) begin
- ma = a[21:12];
- #1
- case (a[23:22])
- 0: mras = 0;
- 1: vras = 0;
- endcase
- @(posedge clock); // wait 60 nS
- @(posedge clock);
- @(posedge clock);
- @(posedge clock);
- @(posedge clock);
- @(posedge clock);
- end
- w = ~rw;
- ma = a[11:2];
- #1
- cas = 0;
- @(posedge clock); // wait 40 nS
- @(posedge clock);
- @(posedge clock);
- @(posedge clock);
- if (near) begin
- ack = 0;
- @(posedge clock); // and 20 more
- ack = 1;
- cas = 1;
- @(posedge clock);
- end else begin
- ack = 0;
- @(posedge clock); // and 20 more
- ack = 1;
- cas = 1;
- mras = 1;
- vras = 1;
- @(posedge clock); // wait 80 nS (RAS precharge time)
- @(posedge clock);
- @(posedge clock);
- @(posedge clock);
- @(posedge clock);
- @(posedge clock);
- end
- end
-
- endmodule